home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue29 / construc / INDEXBOB.DPR < prev    next >
Encoding:
Text File  |  1997-11-30  |  756 b   |  28 lines

  1. {$APPTYPE CONSOLE}
  2. uses
  3.   SysUtils,
  4.   DrBobCGI, // read Keyword from CGI "Form"
  5.   IndexBob; // read index.bob and pages.bob
  6. var
  7.   Keyword: ShortString;
  8.   Found: TPageSet;
  9.   i: Integer;
  10.  
  11. begin
  12.   writeln('<H2>IndexBob Search Results</H2>');
  13.   Keyword := Value('Keyword');
  14.   writeln('Keyword: <B>',Keyword,'</B><BR>');
  15.   if root <> nil then
  16.     if Length(Keyword) in [3..MaxKeyword] then
  17.       Found := Found * root.FindKeywordInPages(LowerCase(Keyword))
  18.     else
  19.       Found := []; // no pages found
  20.   writeln('<BR>');
  21.   writeln('<B>',Pages(Found),'</B> pages found:');
  22.   writeln('<UL>');
  23.   for i:=0 to WebPages-1 do
  24.     if i in Found then
  25.       writeln('<LI><A HREF="',WebPage[i],'">',WebPage[i],'</A>');
  26.   writeln('</UL>');
  27. end.
  28.